﻿@model MileageStats.Domain.Models.ReminderSummaryModel
@{
    ViewBag.Title = "Reminders for " + ViewBag.VehicleName;
    Layout = "~/Views/Shared/_Layout.Mobile.cshtml";
}
<nav>
    <ol class="title">
        <li><a href="@Url.Action("Index", "Dashboard")" class="dashboard icon only"><span>Dashboard</span></a></li>
        <li>@Mustache.ViewBag("VehicleName")</li>
    </ol>
@using (var section1 = Mustache.Section("Model"))
{
    <ol class="breadcrumbs">
        <li><a href="@Url.UnencodedAction("List", "Reminder", new {vehicleId = Mustache.Value(m => m.VehicleId)})">Reminders</a></li>
        <li>@Mustache.Value(m => m.Title)</li>
    </ol>
}
</nav>
@{Html.RenderPartial("_Flash.Mobile");}
@using (var section = Mustache.Section("Model"))
{
    <div class="view">
        <h2>Reminder Details</h2>
        <dl class="list">
            <dt>@Html.Label("Title")</dt>
            <dd>@Mustache.Value(m => m.Title)</dd>

            <dt>@Html.Label("Remarks")</dt>
            <dd>@Mustache.Value(m => m.Remarks)</dd>

            <dt>@Html.Label("Due Date")</dt>
            <dd>@Mustache.Value(m => m.DueDate)</dd>

            <dt>@Html.Label("Due when odometer reads")</dt>
            <dd>@Mustache.Value(m => m.DueDistance)</dd>

        </dl>
    
        <ol class="hbox button-group">
            <li>
                <form action="@Url.UnencodedAction("Fulfill", "Reminder", new {id = Mustache.Value(m => m.ReminderId), vehicleId = Mustache.Value(m => m.VehicleId)})" method="post">
                    @if(Html.IsRenderingForMustache()){
                        @Html.Raw("{{#IsFulfilled}}")
                        <button type="submit" value="fulfill" name="action" disabled><span>Fulfill</span></button>
                        @Html.Raw("{{/IsFulfilled}}")
                        @Html.Raw("{{^IsFulfilled}}")
                        <button type="submit" value="fulfill" name="action"><span>Fulfill</span></button>
                        @Html.Raw("{{/IsFulfilled}}")
                    }
                    else
                    {
                        <button type="submit" value="fulfill" name="action" @(Model.IsFulfilled ? "disabled" : "")>
                            <span>Fulfill</span>
                        </button>
                    }
                </form>
            </li>
            <li class="icon false invert"><a href="@Url.UnencodedAction("List", "Reminder", new { vehicleId = Mustache.Value(m => m.VehicleId)})"><span>Cancel</span></a></li>
        </ol>
    </div>
}